package com.cyt.web.controller.sys;

import com.cyt.base.enums.BusinessType;
import com.cyt.base.enums.OperatorType;
import com.cyt.base.model.dto.ReturnResult;
import com.cyt.sys.aspect.BaseLog;
import com.cyt.sys.model.vo.SysLogLoginVo;
import com.cyt.sys.service.SysLogLoginService;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author: YuShengQiang
 * @Date: 2018-11-22 10:00
 * @Description:登录日志控制层
 */
@RestController
public class SysLogLoginController extends SysBaseController {

    @Resource
    private SysLogLoginService sysLogLoginService;

    /**
     * @Author: YuShengQiang
     * @Date: 2018-11-23 9:19
     * @Description:系统模块统一跳转处理
     */
    @RequestMapping("/sys/logLogin/*")
    public Model goPage(Model model) {
        return model;
    }

    /**
     * @Author: YuShengQiang
     * @Date: 2018-11-23 14:19
     * @Description: 分页查询，page:当前页面，limit:页面大小
     */
    @BaseLog(module = "系统模块", classz = "登录日志管理", methods = "分页查询", businessType = BusinessType.GET, operatorType = OperatorType.MANAGE)
    @RequestMapping(value = "/sysLogLogin/page", method = RequestMethod.POST)
    public ReturnResult page(SysLogLoginVo sysLogLoginVo, int page, int limit) {
        ReturnResult returnResult = sysLogLoginService.page(sysLogLoginVo, limit, page);
        return returnResult;
    }


}
